import axios from 'axios'
import request9191 from "./request9191.js";

const request5151 = axios.create({
    baseURL: 'http://localhost:5151',
    timeout: 5000,
    withCredentials: true // 允许携带凭证
})
request5151.interceptors.request.use((config) => {
//如果存在token，请求携带token
    if(window.sessionStorage.getItem('token')){
        console.log('token'+window.sessionStorage.getItem('token'))
        config.headers['token'] = window.sessionStorage.getItem('token');
    }
    return config ;
}, (error) => {
    Message.error({ message: error });
})
export default request5151
